/*
 * @Author: niuxb 951259738@qq.com
 * @Date: 2022-06-07 09:36:04
 * @LastEditors: niuxb 951259738@qq.com
 * @LastEditTime: 2022-06-24 14:46:44
 * @FilePath: /syq/src/router/index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout/Layout';

Vue.use(Router)
export const constantRouterMap = [
  
  {
    path: '',
    redirect: '/mainview'
  },{
    path:'/mainview',
    name: 'mainview',
    component:()=>
    import('@/views/mainview')
  },{
    path: '/success',
    component: Layout,
    children: [{
      meta: {
        title: '提示'
      },
      name: 'success',
      path: '',
      component: () => import('@/views/success')
    }]
  },{
    path: '/userset',
    name: 'userset',
    component: () => import('@/views/userset')
  },{
    path: '/colorfulLife',
    component: Layout,
    children: [{
      meta: {
        title: '七彩生活广场'
      },
      name: 'colorfulLife',
      path: '',
      component: () => import('@/views/colorfulLife')
    }]
  },{
    path: '/newColorfulLife',
    component: Layout,
    children: [{
      meta: {
        title: '七彩生活广场'
      },
      name: 'newColorfulLife',
      path: '',
      component: () => import('@/views/newColorfulLife')
    }]
  },{
    path: '/colorfulLifeList',
    component: Layout,
    children: [{
      meta: {
        title: '七彩生活广场'
      },
      name: 'colorfulLifeList',
      path: '',
      component: () => import('@/views/colorfulLifeList')
    }]
  },{
    path: '/colorfulLifeDetail',
    component: Layout,
    children: [{
      meta: {
        title: '七彩生活广场',
        keepAlive: false
      },
      name: 'colorfulLifeDetail',
      path: '',
      component: () => import('@/views/colorfulLifeDetail')
    }]
  },{
    path: '/drawdetail',
    component: Layout,
    children: [{
      meta: {
        title: '发帖'
      },
      name: 'drawdetail',
      path: '',
      component: () => import('@/views/drawdetail')
    }]
  },{
    path:'/newcenter',
    name: 'newcenter',
    component:()=> import('@/views/newcenter')
  },{
    path:'/myword',
    component:Layout,
    children:[{
      meta:{
        title:'我的帖子'
      },
      name:"myword",
      path:'',
      component:()=>import('@/views/myword')
    }]
  },{
    path:'/mypinglun',
    component:Layout,
    children:[{
      meta:{
        title:'我的评论'
      },
      name:"mypinglun",
      path:'',
      component:()=>import('@/views/mypinglun')
    }]
  },{
    path:'/myguanzhu',
    component:Layout,
    children:[{
      meta:{
        title:'我的关注'
      },
      name:"myguanzhu",
      path:'',
      component:()=>import('@/views/myguanzhu')
    }]
  },{
    path:'/myfans',
    component:Layout,
    children:[{
      meta:{
        title:'我的粉丝'
      },
      name:"myfans",
      path:'',
      component:()=>import('@/views/myfans')
    }]
  },{
    path: '/newcolordetail',
    component: Layout,
    children: [{
      meta: {
        title: '七彩生活广场',
        keepAlive: false
      },
      name: 'newcolordetail',
      path: '',
      component: () => import('@/views/newcolordetail')
    }]
  },{
    path: '/onlyword',
    name: 'onlyword',
    component: () => import('@/views/onlyword')
  },{
    path: '/about',
    name: 'about',
    component: () => import('@/views/about')
  },{
    path: '/aboutview1',
    component: Layout,
    children:[{
      meta:{
        title:'使用说明'
      },
      name: 'aboutview1',
      path: '/aboutview1',
      component: () => import('@/views/about/aboutview1')
    }]
    
  },{
    path: '/aboutview2',
    component: Layout,
    children:[{
      meta:{
        title:'关于我们'
      },
      name: 'aboutview2',
      path: '/aboutview2',
      component: () => import('@/views/about/aboutview2')
    }]
  },{
    path: '/aboutview3',
    component: Layout,
    children:[{
      meta:{
        title:'管理规定'
      },
      name: 'aboutview3',
      path: '/aboutview3',
      component: () => import('@/views/about/aboutview3')
    }]
  },{
    path: '/aboutview4',
    component: Layout,
    children:[{
      meta:{
        title:'帮助'
      },
      name: 'aboutview4',
      path: '/aboutview4',
      component: () => import('@/views/about/aboutview4')
    }]
  },{
    path: '/erroview',
    name: 'erroview',
    component: () => import('@/views/erroview')
  },{
    path: '/bidden',
    component: Layout,
    children:[{
      meta:{
        title:'禁言时长'
      },
      name: 'bidden',
      path: '/bidden',
      component: () => import('@/views/bidden')
    }]
  },
];

export default new Router({
  routes: constantRouterMap,
  scrollBehavior(to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return {
        x: 0,
        y: 0
      }
    }
  }
})